function renderHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var fieldName = cm.getDataIndex(columnIndex);
	if (fieldName == 'IF_TITLE') {
		var resultString = String.format('<a href="' + context
						+ '/app/info.do?method=editinfo&id={0}">{1}</a>',
				record.data['IF_ID'], value);

		return resultString;
	} else if (fieldName == 'IF_DATE') {
		return formatDate(value);
	} else if (fieldName == 'IF_STATUS') {
		if (value == '0') {
			return '待审核';
		} else if (value == '1') {
			return '通过';
		} else if (value == '-1') {
			return '未通过';
		}
	} else if (fieldName == 'SP') {
		var str = '<a href="javascript:handleDelete(\''
				+ record.data['IF_ID'] + '\');">删除</a>';
		return str;
	}
	return value;
}

/**
 * 添加“过滤按钮”
 * 
 * @param {}
 *            grid
 */
function addMeMix(key) {
	var tbar = Ext.getCmp(key + '_toolbar');

	tbar.add('-', {
				text : '新建信息',
				iconCls : 'addinfo',
				handler : function() {
					var url = context + '/app/info.do?method=neuinfo&did='
							+ getParameter('did');
					document.location = url;
					// window.location.href = context +
					// '/app/info/neuinfo4directory.jsp';
				}
			});

}

function getParameter(name) {
	var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
	if (reg.test(location.href))
		return unescape(RegExp.$2.replace(/\+/g, " "));
	return "";
};

function handleDelete(id) {
	if (confirm("确定删除内容信息")) {
		Ext.MessageBox.wait('删除处理过程中...');
		Ext.Ajax.request({
					// 请求地址
					url : context + '/app/info.do?method=deleteinfo',
					params : {
						ids : id,
						ifdel : '1'
					},
					// 成功时回调
					success : function(response, options) {
						// 获取响应的json字符串
						Ext.MessageBox.hide();

						var json = response.responseText;
						var o = Ext.util.JSON.decode(json);

						if (o.success) {
							handleRefresh();
						} else {
							Ext.Msg.alert('提示', '删除失败!');
						}
					}
				});
	}
}